package org.bp.spider.only;

import java.util.ArrayList;
import java.util.List;

public class Main {
	public static void main(String[] args) throws Exception {
        // properties cookie的键值对 比如 a=xxx \n  b=yyy
		String cookieFile = "R:\\temp\\1.properties";
		String url = "http://www.qixin.com/search?area.province=15&key=%E6%95%99%E8%82%B2%E5%9F%B9%E8%AE%AD&page=bp&status[]=1";
		int pageCount = 15;
		QueryCompany queryCompany = new QueryCompany();
		List<Company> list = new ArrayList<>();// queryCompany.queryCompany("",cookieFile);
		for (int i = 5; i <= pageCount; i++) {
			List<Company> companys = queryCompany.queryCompany(url.replace("bp", "" + i), cookieFile);
			System.out.println(companys.size());
			list.addAll(companys);
		}
		StoreCompany storeCompany = new StoreCompany();
		storeCompany.storeCompany(list);




	}
}
